<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>品刊详情页</title>
    <link rel="stylesheet" href="css/clear.css">
    <link rel="stylesheet" href="css/Journal-details.css">
    <script src="js/formula.js"></script>
</head>
<body>

<div id="div1"></div>

<div class="div1"></div>
<div class="div2"></div>
<div class="div3"></div>
<div class="div4"></div>


<script src="js/jquery-2.1.4.js"></script>

<script>
    $.ajax({
        url: "http://192.168.2.37/PHPProject/PHPTest/api/category",
        type: "get",
        dataType: 'jsonp',
        data: {
        },
        jsonp:'callback',
        success: function(result) {
            console.log(result)
            var oUl=document.createElement("ul");
            for (var i = 0; i < result.data.length; i++) {
                var aLi=document.createElement("li");
                var oA=document.createElement("a");
                oA.append((i + 1).toString() + "." + result.data[i].title);
                $(oA).attr("href","list.html?&category_id=" + result.data[i].id);
                aLi.append(oA);
                oUl.appendChild(aLi);
            }
            $("#div1").html(oUl)
        },
        error: function(error) {
            console.log(error)
        }
    });








</script>








</body>
</html>